let isTestLocalServer = false;
const hostname = window.location.hostname;
let baseUrl;
let baseUrl28 = 'http://192.168.100.28:14602';
let baseUrl193 = 'http://172.18.59.193:14602';

//服务器,线上自动判断,开发时可以手动切
let serverNum = 193;

if (hostname == "smart.haitian.com") {
    //外网地址访问
    baseUrl = "http://smart.haitian.com/";
    serverNum = 28;
}
if (hostname == "co.haitianiot.com") {
    //外网地址访问
    baseUrl = "http://co.haitianiot.com:9091";
    serverNum = 30;
}
else if (hostname == "smartds.haitian.com") {
    //外网地址访问
    baseUrl = "http://smartds.haitian.com:9091";
    serverNum = 246;
}
else if (hostname == "htqdds.haitian.com") {
    //外网地址访问
    baseUrl = "http://htqdds.haitian.com:9911";
    serverNum = 193;
}
else if (hostname == "192.168.100.28") {
    //内网地址访问
    baseUrl = "http://192.168.100.28:900";
    serverNum = 28;
}
else if (hostname == "192.168.100.30") {
    //内网地址访问
    baseUrl = "http://192.168.100.30:9091";
    serverNum = 30;
}
else if (hostname == "192.168.101.246") {
    //内网地址访问
    baseUrl = "http://192.168.101.246:9091";
    serverNum = 246;
}
else if (hostname == "172.18.59.193") {
    //内网地址访问
    baseUrl = "http://172.18.59.193:9911";
    serverNum = 193;
}
else if (hostname == "localhost" || hostname == '172.18.59.214') {
    //开发环境
    baseUrl = "cstApi/";
    if (isTestLocalServer) {
        baseUrl28 = `http://${hostname}:14602`;
        baseUrl193 = `http://${hostname}:14602`;
    }
}
console.log('serverNum :>> ', serverNum);

module.exports = {
    baseUrl,
    baseUrl28,
    baseUrl193,
    serverNum,
};
//配置接口地址
